/**
* Global Sidebar
* ============================================================================
*/

.navbar {
  background-color: @header-bg-color;
  color: #fff;
  font-size: 15px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: @sidebar-width;
  z-index: @zindex-navbar-fixed;
  padding: 0 14px;
  .clearfix();
  display: flex;
  flex-direction: column;

  .anchor-top {
    flex: 1;
    align-self: flex-start;
  }

  .icon-sentry-logo, .icon-sentry-logo-full {
    line-height: 40px;
  }

  .admin-action-message {
    line-height: 42px;
    display: block;
    float: right;
    font-size: 13px;
    font-weight: bold;
    padding-right: 10px;
    .animated;
    .animated.infinite;
    .animated.hinge;
    .flash-50;
  }

  .logo {
    display: block;
    float: left;
    text-align: center;
    font-size: 22px;
    color: lighten(#b9b2d0, 5) !important;
    margin: 0;

    &:hover {
      color: #fff !important;
    }
  }

  .global-nav {
    .list-unstyled();
    margin: 0;

    li {
      float: left;
      margin-right: 16px;
      margin-left: 15px;

      a {
        height: 40px;
        line-height: 42px;
      }
    }
  }

  .org-selector {
    padding: 15px 0;
    position: relative;

    .hover-bar-container {
      position: absolute;
      width: 32px;
      height: 3px;
      bottom: -2px;
      border-radius: 2px;
      overflow: hidden;

      .hover-bar {
        width: 0;
        height: 3px;
        background: rgba(255,255,255, .35);
        -webkit-transition: width 500ms ease;
      }
    }

    &:hover {
      .hover-bar-container {
        background: #625c69;
      }
      .hover-bar {
        width: 100%;
      }
    }

    &.active{
      &:before {
        position: absolute;
        display: block;
        content: "";
        right: -14px;
        top: 50%;
        margin-top: -6px;
        border-top: 7px solid transparent;
        border-bottom: 7px solid transparent;
        border-right: 7px solid #F7F8F9;
      }
      &:hover {
        .hover-bar-container {
          display: none;
        }
      }
    }

    .org-list {
      > li {
        padding: 15px 20px 10px 68px;
        border-bottom: 1px solid @trim;
        position: relative;
        background: #fff;

        a {
          color: @50;

          &:hover {
            color: @70;
          }
        }

        h5, p {
          margin: 0;
        }

        h5 {
          font-size: 16px;
          margin-bottom: 2px;

          a {
            color: @80;

            &:hover {
              color: @90;
            }
          }
        }

        p {
          font-size: 13px;
          a {
            margin-right: 10px;
          }
        }

        &.active {
          background: #F5FAFE;
          border-top: 1px solid #B5D6ED;
          border-bottom: 1px solid #B5D6ED;
          margin-top: -1px;

          a {
            color: desaturate(darken(@blue-dark, 25), 10);
            opacity: .8;
            .transition(.2s opacity);

            &:hover {
              opacity: 1;
            }
          }

          p {
            a {
              color: desaturate(darken(@blue-dark, 25), 10);
              opacity: .6;

              &:hover {
                opacity: .8;
              }
            }
          }
        }

        &.org-create {
          padding: 15px 20px;
          background: none;

          a {
            color: @70;

            &:hover {
              color: @90;
            }
          }
        }
      }

      .org-avatar {
        position: absolute;
        display: block;
        left: 20px;
        .square(36px);
        background-color: @50;
        border-radius: 3px;
        text-align: center;
        line-height: 36px;
        color: #fff;

        &:hover, &:active, &:focus {
          color: #fff;
        }
      }
    }

    .active-org {
      display: block;
      .square(32px);
      &:before {
        display: block;
        position: absolute;
        content: "";
        top: 0;
        left: -15px;
        right: -15px;
        bottom: -5px;
      }

      img {
        border-radius: 3px;
        box-shadow: 0 1px 1px rgba(0,0,0, .3);
      }
    }
  }

  .navbar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;

    .list-unstyled;
    padding: 14px 0 6px;
    margin: 0;

    > li {
      position: relative;
      text-align: center;
      margin: 0 0 5px;

      > a {
        color: #b9b2d0;
        display: block;
        width: 32px;
        line-height: 32px;

        .icon {
          display: block;
          line-height: 30px;
        }

        &:hover, &:focus, &:active {
          color: #fff;
        }
      }

      &.active {
        > a {
          color: #fff;
        }

        &:before {
          position: absolute;
          display: block;
          content: "";
          right: -14px;
          top: 50%;
          margin-top: -7px;
          border-top: 7px solid transparent;
          border-bottom: 7px solid transparent;
          border-right: 7px solid #F7F8F9;
        }
      }
    }

    > li.onboarding {
      max-height: 9999em;
      margin: 12px 0;
    }

    .icon-home, .icon-user, .icon-star-solid {
      font-size: 18px;
    }

    .icon-av_timer {
      font-size: 25px;
    }

    .icon-globe, .icon-alert, .icon-support {
      font-size: 20px;
    }

    .activity-indicator {
      position: absolute;
      top: 2px;
      right: 3px;
      .square(8px);
      background: @red;
      border-radius: 50%;
      box-shadow: 0 0 0 3px @header-bg-color;
    }
  }

  .divider-top {
    border-top: 1px solid lighten(#342c3e, 10);
  }

  .divider-bottom {
    border-bottom: 1px solid lighten(#342c3e, 10);
  }

  .org-selector {
    .dropdown-menu {
      top: 38px;
    }
  }

  .user-settings {
    .avatar {
      .square(32px);
      box-shadow: 0 1px 1px rggba(0,0,0, .3);
    }

    .dropdown-toggle {
      display: block;
      margin-top: 5px;
    }

    .dropdown-menu {
      left: 34px;
      top: auto;
      bottom: -4px;
      background: @90;
      border-color: transparent;
      box-shadow: 0 1px 3px rgba(0,0,0, .25);
      color: #fff;
      border-radius: 4px;

      a {
        color: @20;

        &:hover {
          color: @purple-light;
          background: transparent;
        }
      }

      &:before {
        display: none;
      }

      &:after {
        top: auto;
        left: -18px;
        bottom: 12px;
        border: 9px solid transparent;
        border-right: 9px solid @90;
      }
    }
  }

  .onboarding-progress-bar {
    margin: 0 8px;
  }

  .dropdown-toggle {
    .icon-arrow-down {
      color: #83899D;
      font-size: 12px !important;
      top: 1px;
      margin-left: 4px;
    }

    .avatar {
      border-radius: 2px;
      position: relative;
    }
  }

  .dropdown.open {
    .dropdown-toggle {
      color: #fff;
      background: rgba(0,0,0, .3);
    }
  }
}

// Status update

.navbar .icon-alert {
  color: @yellow-orange;
}

.sidebar-panel {
  position: fixed;
  width: @sidebar-panel-width;
  top: 0;
  left: @sidebar-width;
  bottom: 0;
  background: @white-darker;
  z-index: @zindex-sidebar-panel;
  color: @gray-darker;
  border-right: 1px solid @trim;
  box-shadow: 1px 0 2px rgba(0,0,0, .06);
  text-align: left;
  line-height: 24px;


  .sidebar-panel-header {
    border-bottom: 1px solid @trim;
    padding: 23px 20px 20px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0, .06);
    height: @sidebar-panel-header-height;

    .close {
      font-size: 22px;
      position: relative;
      top: -3px;
      right: -3px;
      color: @30;

      &:hover {
        color: @50;
      }
    }

    h2 {
      font-size: 18px;
      margin: 0;
      font-weight: normal;
    }
  }

  .sidebar-panel-body {
    position: absolute;
    top: @sidebar-panel-header-height;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;

    .box {
      border: 0;
      background: transparent;
      box-shadow: none;

      .loading-indicator {
        border-top: 6px solid @gray-lightest;
        border-right: 6px solid @gray-lightest;
        border-bottom: 6px solid @gray-lightest;
        border-left: 6px solid @gray;
      }
    }

    .issue-list {
      border: none;
      box-shadow: none;

      .issue {
        border-bottom: 1px solid #e2dee6;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06)
      }
    }
  }

  .sidebar-panel-item {
    padding: 15px 20px;
    line-height: 1.2;
    border-bottom: 1px solid @trim;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0, .06);
    font-size: 14px;

    h3 {
      font-size: 15px;
      margin-bottom: 5px;
      .culprit {
        font-weight: normal;
      }
    }

    p {
      margin-bottom: 5px;

      &:last-child {
        margin: 0;
      }
    }

    a {
      color: @50;

      &:hover {
        color: @70;
      }
    }

    .message {
      color: @gray-dark;
    }

    &.active {
      background: @10;
      border-color: @30;
      border-top: 1px solid @30;
      margin-top: -1px;
    }

    &.has-seen h3 {
      font-weight: normal;
    }
  }

  .sidebar-panel-empty {
    color: @50;
    text-align: center;
    width: 100%;
    position: absolute;
    top: 50%;
    padding: 0 60px;
    margin-top: (-62px + -16px) / 2; // offset for sidebar-panel-header + font-size
  }
}

.incident-list {
  padding: 20px 20px 0;
  font-size: 13px;

  h4, p, h6  {
     margin-bottom: 15px;
  }

  h4 {
    font-size: 18px;
    line-height: 1.2;
  }

  h6 {
    color: @60;
  }

  p {
    line-height: 1.5;
  }

  small {
    color: @60;
  }

  .incident-item {
    border-bottom: 1px solid @trim;
    margin-bottom: 20px;
    padding-bottom: 5px;
  }
}

.range-picker {
  .dropdown-toggle {
    font-size: 18px;
    font-weight: 600;

    .icon-arrow-down {
      top: 2px;
      margin-left: 4px;
    }
  }
}

/**
* Print
* ============================================================================
*/

@media print {
  .navbar {
      display: none;
  }
}

/**
* Responsive small screens
* ============================================================================
*/

@media(max-width:767px) {
  @sidebar-panel-offset: 54px;

  body {
    padding-left: 0;
  }

  .navbar {
    flex-direction: row;
    position: static;
    width: 100%;
    max-height: @sidebar-panel-offset;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 30px;

    .navbar-nav {
      flex-direction: row;
      padding: 0 6px 0 10px;

      > li {
        margin: 0 5px 0 0;

        &.active:before {
          top: auto;
          right: auto;
          bottom: -11px;
          left: 50%;
          margin-left: -6px;
          border-bottom: 7px solid #F7F8F9;
          border-right: 7px solid transparent;
          border-left: 7px solid transparent;
          border-top: 7px solid transparent;
        }

        &.onboarding {
          display: none;
        }
      }
    }

    .divider-bottom {
      border: 0;
      border-right: 1px solid @gray;
    }

    .anchor-top {
      display: flex;

      > div {
        display: flex;
      }

      .org-selector {
        padding: 0;
        padding-right: 14px;

        &.active:before {
          top: auto;
          right: auto;
          bottom: -10px;
          left: 50%;
          margin-left: -12px;
          border-bottom: 7px solid #F7F8F9;
          border-right: 7px solid transparent;
          border-left: 7px solid transparent;
          border-top: 7px solid transparent;
        }
      }
    }

    .anchor-bottom {
      display: flex;

      .navbar-nav {
        padding-right: 0;

        > li:last-child {
          margin: 0;
        }
      }
    }

    .user-settings {
      display: block;
      margin-left: 5px;

      .dropdown-toggle {
        margin-top: 0;
      }

      .dropdown-menu {
        left: auto;
        top: 42px;
        right: -3px;
        bottom: auto;

        &:after {
          top: -16px;
          right: 10px;
          left: auto;
          bottom: auto;
          border: 9px solid transparent;
          border-bottom: 9px solid @90;
        }
      }
    }
  }

  .sidebar-panel {
    width: auto;
    top: @sidebar-panel-offset;
    left: 0;
    right: 0;
  }
}
